import React from 'react';
import { useRouteError } from 'react-router-dom';

export default function ErrorComponent() {
  const error: any = useRouteError();
  return (
    <div>
      <h1>页面错误: {error.data}</h1>
      <p>错误代码: {error.status}</p>
      <p>错误提示: {error.statusText}</p>
    </div>
  );
}
